disable a button in javascript for a time period

146

disable a button in javascript for a time period -

const btn = document.getElementById("myBtn")
function myFunction() {
  btn.disabled = true;
  setTimeout(()=>{
    btn.disabled = false;
    console.log('Button Activated')}, 5000)
}

Comments

Submit
0 Comments